<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>vue的v-for</title>
    <script src="https://cdn.bootcss.com/vue/2.5.17-beta.0/vue.min.js"></script>

</head>
<body>

    <div id="app">
        <!--绑定城市-->
        <ul>
            <li v-for="(cityName,index) in cityList":id="index" v-html="cityName"></li>
        </ul>
        <table border="1" cellpadding="0" align="center" width="500">
            <tr>
                <th>编号</th>
                <th>姓名</th>
                <th>年龄</th>
                <th>地址</th>
            </tr>
            <tr v-for="(linkman,index) in linkmanList">
                <td v-html="index+1"></td>
                <td v-html="linkman.name"></td>
                <td v-html="linkman.age"></td>
                <td v-html="linkman.address"></td>
            </tr>
        </table>
    </div>
    <script type="text/javascript">
        new Vue({
            el:"#app",
            data:{
                cityList:["北京","上海","深圳"],
                linkmanList:[
                    {
                        name:"张三",
                        age:18,
                        address:"深圳"
                    },
                    {
                        name:"李四",
                        age:18,
                        address:"北京"
                    },
                    {
                        name:"王五",
                        age:18,
                        address:"上海"
                    }
                ]
            }
        });
    </script>
</body>
</html>